<?php
if(!defined("IICCMS")) exit("Access Denied");
class EmptyAction extends Action{	
	public function _empty(){
		if(MODULE_NAME!='Urlrule'){
			$Mod = F('Mod');
			if(!$Mod[MODULE_NAME]){ 
				$this->display(THINK_PATH.'/Tpl/Autoindex/hello.html');
			}
		}
		if(GROUP_NAME=='Admin'){
			R('Admin.Content',ACTION_NAME);
		}else{
			$a=ACTION_NAME;
			$id =  intval($_REQUEST['id']);
			$catid = intval($_REQUEST['catid']);
			$moduleid =  intval($_REQUEST['moduleid']);
			if(MODULE_NAME=='Urlrule'){
				if($_REQUEST['catdir']){
					$Cat = F('Cat');
					$catid = $catid ? $catid : $Cat[$_REQUEST['catdir']];
				}
				if($_REQUEST['module']){
					$m=$_REQUEST['module'];						
				}elseif($moduleid){
					$Module =F('Module');
					$m=$Module[$moduleid]['module'];
				}elseif($catid){
					$Category = F('Category');
					$m=$Category[$catid]['module'];
				}else{
					$this->display(THINK_PATH.'/Tpl/Autoindex/hello.html');
				}
				if($a=='index') $id=$catid;
			}else{
				if(empty($id)){
					$Cat = F('Cat');
					$id = $Cat[$_REQUEST['id']];
				}
				$m=MODULE_NAME;
			
			}
//		dump(GROUP_NAME);
//		dump(MODULE_NAME);
//		dump(ACTION_NAME);
//		dump($_GET);
			import('@.Action.Base');
			$bae=new BaseAction();
			if(!method_exists($bae,$a) || empty($id)){
				$this->display(THINK_PATH.'/Tpl/Autoindex/hello.html');
			}
			$bae->$a($id,$m);			 
		}
	}

}

				

?>